Skip to content

v2.7.2: 更新JM内置域名; 废弃 get_html_domain_all_via_github 并移除失效的 GitHub 域名抓取实现; 完善 async API,新增 categories_filter_gen; 补充测试和异步使用文档#549

Merged
hect0x7 merged 6 commits into
masterfrom
dev
Jul 16, 2026
Merged

Conversation

@hect0x7

@hect0x7 hect0x7 commented Jul 15, 2026

Copy link
Copy Markdown
Owner

完善 async downloader 初始化失败时的资源清理; 优化 async 域名与 Cookie 初始化逻辑并支持显式 domain_list; 新增 categories_filter_gen 并支持同步与异步 callback; 废弃 get_html_domain_all_via_github 并移除失效的 GitHub 域名抓取实现; 补充测试和异步使用文档

Summary by CodeRabbit

  • New Features
    • Added domain_list support when creating asynchronous clients.
    • Added categories_filter_gen for async, auto-paginated category retrieval.
    • Async download callbacks now support both synchronous and asynchronous functions.
  • Bug Fixes
    • Improved async downloader/client startup failure cleanup to avoid leaked resources.
    • Stricter domain initialization and safer domain updates during setup (including cookie handling).
    • Deprecated GitHub domain helper now properly emits a deprecation warning and forwards to the modern method.
  • Documentation
    • Updated tutorials with clearer async performance guidance and removed the GitHub fallback example (with deprecation notes).
  • Release
    • Version bumped to 2.7.2.

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ccb1f8ad-bbfe-40b1-98ff-2ac21e8531c4

📥 Commits

Reviewing files that changed from the base of the PR and between 5d054b1 and fd82195.

📒 Files selected for processing (1)
  • src/jmcomic/jm_config.py

📝 Walkthrough

Walkthrough

The release deprecates GitHub-based domain fetching, adds explicit async domain handling and paginated category iteration, improves callback support and setup cleanup, updates tutorials and tests, revises benchmark reporting, and increments the package version to 2.7.2.

Changes

Async and domain API updates

Layer / File(s) Summary
Domain compatibility and deprecation
src/jmcomic/jm_config.py, src/jmcomic/jm_client_interface.py, tests/test_jmcomic/test_jm_api.py, assets/docs/sources/tutorial/12_domain_strategy.md, assets/docs/sources/tutorial/8_pick_domain.md, src/jmcomic/__init__.py
GitHub-based domain fetching now warns and forwards to get_html_domain_all; domain lists, examples, tests, and the package version are updated.
Async client domains and setup
src/jmcomic/jm_async_client.py, src/jmcomic/jm_option.py, tests/test_jmcomic/test_jm_async_custom.py
Async clients accept normalized explicit domain lists, reject unsupported retry configuration, separate domain and cookie setup, and validate initialization behavior.
Async download callbacks and cleanup
src/jmcomic/api.py, src/jmcomic/jm_async_downloader.py, tests/test_jmcomic/test_jm_async_api.py, tests/test_jmcomic/test_jm_async_custom.py
Download APIs support synchronous or asynchronous callbacks, while setup failures clean up the client and decode pool.
Async pagination usage
src/jmcomic/jm_client_interface.py, tests/test_jmcomic/test_jm_async_client.py, assets/docs/sources/tutorial/14_async_usage.md
Adds categories_filter_gen() and updates async pagination, lifecycle, downloader, and performance examples.
Benchmark reporting and repository metadata
usage/benchmark_async_vs_sync.py, .github/workflows/benchmark.yml, .gitignore
Benchmark output now presents conclusion-first comparisons, and repository metadata labels are updated.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant download_album_async
  participant JmAsyncDownloader
  participant AsyncJmApiClient
  participant callback
  download_album_async->>JmAsyncDownloader: initialize and download album
  JmAsyncDownloader->>AsyncJmApiClient: setup and close client
  download_album_async->>callback: invoke with album and downloader
  callback-->>download_album_async: return or await callback result
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 73.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题准确概括了本次 PR 的主要改动:内置域名更新、GitHub 域名抓取弃用、async API 增强以及测试和文档补充。
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@hect0x7 hect0x7 changed the title v2.7.2: 完善 async downloader 初始化失败时的资源清理; 优化 async 域名与 Cookie 初始化逻辑并支持显式 domain_list; 新增 categories_filter_gen 并支持同步与异步 callback; 废弃 get_html_domain_all_via_github 并移除失效的 GitHub 域名抓取实现; 补充测试和异步使用文档 v2.7.2 Jul 15, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@assets/docs/sources/tutorial/14_async_usage.md`:
- Around line 205-209: Update the categories_filter_gen example to pass the
API’s all-category value, using JmMagicConstants.CATEGORY_ALL or its equivalent
'0' instead of the literal 'all'.

In `@src/jmcomic/jm_async_client.py`:
- Around line 740-746: Preserve constructor-provided domains during setup by
tracking whether an explicit domain_list was supplied. Update the setup flow and
auto_update_domain path to avoid replacing that instance list with
JmModuleConfig.DOMAIN_API_UPDATED_LIST when explicit domains exist, while
retaining global-cache behavior for clients without them. Add a regression test
that invokes setup() before asserting the client’s domain list remains
unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 31abac0f-02a9-4d09-8fa5-b23269a79a4e

📥 Commits

Reviewing files that changed from the base of the PR and between 2866026 and d757d51.

📒 Files selected for processing (14)
  • assets/docs/sources/tutorial/12_domain_strategy.md
  • assets/docs/sources/tutorial/14_async_usage.md
  • assets/docs/sources/tutorial/8_pick_domain.md
  • src/jmcomic/__init__.py
  • src/jmcomic/api.py
  • src/jmcomic/jm_async_client.py
  • src/jmcomic/jm_async_downloader.py
  • src/jmcomic/jm_client_interface.py
  • src/jmcomic/jm_config.py
  • src/jmcomic/jm_option.py
  • tests/test_jmcomic/test_jm_api.py
  • tests/test_jmcomic/test_jm_async_api.py
  • tests/test_jmcomic/test_jm_async_client.py
  • tests/test_jmcomic/test_jm_async_custom.py

Comment thread assets/docs/sources/tutorial/14_async_usage.md
Comment thread src/jmcomic/jm_async_client.py Outdated
@hect0x7

hect0x7 commented Jul 16, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai resume

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
✅ Action performed

Reviews resumed.

@hect0x7

hect0x7 commented Jul 16, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@hect0x7 hect0x7 changed the title v2.7.2 v2.7.2: 更新JM内置域名; 废弃 get_html_domain_all_via_github 并移除失效的 GitHub 域名抓取实现; 完善 async API,新增 categories_filter_gen; 补充测试和异步使用文档 Jul 16, 2026
@hect0x7
hect0x7 merged commit e76460b into master Jul 16, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant